package com.linglan.common.config.userinfo;

public class UserContext {
    private final static ThreadLocal<UserInfo> USER_THREAD_LOCAL = new ThreadLocal<>();

    private UserContext() {
    }

    public static void setLoginUser(UserInfo user) {
        USER_THREAD_LOCAL.set(user);
    }

    public static UserInfo getUser() {
        return USER_THREAD_LOCAL.get();
    }

    public static void remove() {
        USER_THREAD_LOCAL.remove();
    }
}